﻿using System.Text;

namespace TPXSDK.NET.Mission.Instruction;

internal class PseudoFastWp : Tokenizer
{
    /// <summary>
    /// 快速航点伪指令
    /// </summary>
    public PseudoFastWp(TokenizerAdmin admin)
    {
        Admin = admin;
        KeyName = "fastwp";
        KeyValue = 0xFD;
        Description = @"Marks the Next flyto cmd use fast waypoint mode.";
        IsPseudo = true;
    }

    /// <inheritdoc />
    /// <summary>
    /// 词元分析器处理过程
    /// </summary>
    public override bool Process()
    {
        var flyCmp = Admin?.Compiler; if (null == flyCmp) return false;
        var tokens = flyCmp.GetLineTokens();
        if (null == tokens) return false;
        flyCmp.FastWpMode = true;
        return true;
    }

    public override void Reverse(FlyCmdItem cmd, StringBuilder sb)
    {
        // not supported for Pseudo
        throw new NotImplementedException();
    }
}
